package com.panshi.api;

import com.panshi.vo.R;
import com.panshi.vo.SysRoleVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "hasbei-sys.com", path = "/api/sys/role")
public interface SysRoleApi {

    @GetMapping("/list")
    List<SysRoleVO> listSysRole();

    //分页查询角色列表
    @GetMapping("/pageRoleList/{current}/{limit}")
    R pageRoleList(@PathVariable Integer current, @PathVariable Integer limit);

    @GetMapping("/{id}")
    SysRoleVO getSysRole(@PathVariable("id")Integer id);

    @PostMapping
    R addSysRole(@Validated @RequestBody SysRoleVO sysRoleVO);

    @PutMapping
    R editSysRole(@Validated @RequestBody SysRoleVO sysRoleVO);

    @DeleteMapping("/{id}")
    R delSysRole(@PathVariable("id")Integer id);


    @GetMapping("/selectRoleList")
    R selectRoleList();

    @GetMapping("/getRoleSelectByUserId/{id}")
    R getRoleSelectByUserId(@PathVariable("id") Integer id);
}
